<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1 {
            width: 100px;
            height: 100px;
            background-color: red;

            /* 绝对定位：
                开启了绝对定位元素脱离文档流
                绝对定位是相对于离他最近的开启了定位的祖先元素进行定位的
                都没开启相对于浏览器窗口定位
            */
            position: absolute;
            top: 0px;
            left: 0px;
        }

        .fa {
            width: 500px;
            height: 400px;
            background-color: gray;
            margin-left: 100px;
            /* 父元素相对定位不设置值 */
            /* position: relative; */
        }

        .box2 {
            width: 100px;
            height: 100px;
            background-color: green;

        }
    </style>
</head>

<body>
    <div class="fa">
        <div class="box1">1</div>
    </div>
    <div class="box2">2</div>
</body>

</html>